﻿/**********************************************************************
 * @file   GUIPropertyShellDialog.h
 * @brief  壳属性Value窗口
 * @author wangning (2185896382@qq.com)
 * @date   2025-08-26
 *********************************************************************/
#ifndef _GUIPropertyShellDialog_H
#define _GUIPropertyShellDialog_H

#include "GUIAnalysisDialogAPI.h"
#include "FITK_Kernel/FITKCore/FITKActionOperator.h"
#include "FITK_Kernel/FITKCore/FITKAbstractGUIDialog.h"

class QComboBox;

namespace Ui
{
    class GUIPropertyDialog;
}
namespace Radioss
{
    class FITKPropShell;
    class FITKPropAbstract;
}
namespace Interface
{
    class FITKAbstractSectionManager;
}
namespace GUI
{
    /**
     * @brief  壳属性Value窗口
     * @author wangning (2185896382@qq.com)
     * @date   2025-08-26
     */
    class GUIAnalysisDialogAPI GUIPropertyShellDialog : public Core::FITKDialog
    {
        Q_OBJECT;
    public:
        /**
         * @brief 构造函数
         * @param[i]  obj          属性对象
         * @param[i]  oper           operator
         * @param[i]  parent
         * @author wangning (2185896382@qq.com)
         * @date   2025-05-23
         */
        explicit GUIPropertyShellDialog(Core::FITKActionOperator* oper, Radioss::FITKPropAbstract* obj, QWidget* parent = nullptr);
        /**
         * @brief Destroy object
         * @author wangning (2185896382@qq.com)
         * @date   2025-08-26
         */
        virtual ~GUIPropertyShellDialog();

    protected:
        /**
        * @brief    UI初始化
        * @return   void
        * @author wangning (2185896382@qq.com)
        * @date   2025-08-26
        */
        void initUI();
        /**
        * @brief    数据初始化
        * @return   void
        * @author wangning (2185896382@qq.com)
        * @date   2025-05-23
        */
        void init();
        /**
         * @brief    检查
         * @author wangning (2185896382@qq.com)
         * @date   2025-05-23
         */
        bool ckeckData();
        /**
         * @brief    从界面获取数据
         * @return   void
         * @author wangning (2185896382@qq.com)
         * @date   2025-05-23
         */
        void getDataFormWidget();
        /**
         * @brief 添加LineEdit
         * @param[i]  label          行标题
         * @param[i]  objname        LineEdit对象名称
         * @author wangning (2185896382@qq.com)
         * @date   2025-08-26
         */
        void addLineEdit(const QString& label,const QString& objname);
        /**
         * @brief 添加ComboBox
         * @param[i]  label          行标题
         * @param[i]  objname        QComboBox对象名称
         * @author wangning (2185896382@qq.com)
         * @date   2025-08-26
         */
        QComboBox* addComboBox(const QString& label, const QString& objname);

        // 获取属性管理器
        Interface::FITKAbstractSectionManager* getSectionManager();

    protected slots:
        /**
        * @brief OK按钮信号
        * @return
        */
        void on_pushButtonOK_clicked();
        /**
        * @brief Cancel按钮信号
        * @return
        */
        void on_pushButtonCancel_clicked();

    protected:
        /**
         * @brief 数据对象
         * @author wangning (2185896382@qq.com)
         * @date   2025-05-23
         */
        Radioss::FITKPropShell* _obj = nullptr;
        /**
         * @brief 操作器对象
         * @author wangning (2185896382@qq.com)
         * @date   2025-05-23
         */
        Core::FITKActionOperator* _oper = nullptr;
        /**
         * @brief  是否是编辑
         * @author wangning (2185896382@qq.com)
         * @date   2025-05-23
         */
        bool _isEditMode{ false };

    protected:
        /**
         * @brief ui
         * @author wangning (2185896382@qq.com)
         * @date   2025-05-23
         */
        Ui::GUIPropertyDialog* _ui = nullptr;
    };
}

#endif
